package com.ibiaoke.boss.controller;

import com.ibiaoke.common.base.Page;
import com.ibiaoke.common.response.Res;
import com.ibiaoke.customer.entity.PtOpenGroup;
import com.ibiaoke.customer.service.OpenGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
@Controller
public class BossPtOpenController {

    @Autowired
    private OpenGroupService openGroupService;

    @RequestMapping("/listOpenGroup")
    @ResponseBody
    public Res listOpenGroup(Integer ptGoodsId, Page page){
        List<PtOpenGroup> openGroupList = openGroupService.bossOpenGroupList(ptGoodsId,page);
        return Res.create().addResponse("openGroupList",openGroupList).addResponse("page",page);
    }

    @RequestMapping("/listOpenGroupByOpenCode")
    @ResponseBody
    public Res listOpenGroupByOpenCode(String openCode, Page page){
        List<PtOpenGroup> openGroupList = openGroupService.listOpenGroupByOpenCode(openCode,page);
        return Res.create().addResponse("openGroupList",openGroupList).addResponse("page",page);
    }
}
